<?php
  require_once './library/config.php';
  require_once './library/functions.php';
  
  $errorMessage = '&nbsp;';
  
  if (isset($_POST['txtUserName'])) {
    $result = doLogin();
    if ($result != '') {
      $errorMessage = $result;
    }    
  }
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>

<body bgcolor="#EEE9E9">
<center>
<p><strong><?php echo $errorMessage; ?></strong></p>
<form method="post" name="frmLogin" id="frmLogin">
<p>Username
  <label for="textfield"></label>
<input type="text" name="txtUserName" id="txtUserName" />
</p>
<p>Password
  <label for="textfield2"></label>
  <input type="password" name="txtPassword" id="txtPassword" />
</p>
<p>
  <input type="submit" name="login" id="login" value="Login" /> &nbsp;
  <input type="submit" name="clear" id="clear" value="Clear" />
</p>
</form>
<p>Forgot the password</p>
</center>
</body>
</html>
